import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SupplierReceivePaymentInfoVO, SupplierReceivePaymentInfoForm, SupplierReceivePaymentInfoQuery } from '@/api/purchase/supplierReceivePaymentInfo/types';

/**
 * 查询供应商收款信息列表
 * @param query
 * @returns {*}
 */

export const listSupplierReceivePaymentInfo = (query?: SupplierReceivePaymentInfoQuery): AxiosPromise<SupplierReceivePaymentInfoVO[]> => {
  return request({
    url: '/purchase/supplierReceivePaymentInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询供应商收款信息详细
 * @param id
 */
export const getSupplierReceivePaymentInfo = (id: string | number): AxiosPromise<SupplierReceivePaymentInfoVO> => {
  return request({
    url: '/purchase/supplierReceivePaymentInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增供应商收款信息
 * @param data
 */
export const addSupplierReceivePaymentInfo = (data: SupplierReceivePaymentInfoForm) => {
  return request({
    url: '/purchase/supplierReceivePaymentInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改供应商收款信息
 * @param data
 */
export const updateSupplierReceivePaymentInfo = (data: SupplierReceivePaymentInfoForm) => {
  return request({
    url: '/purchase/supplierReceivePaymentInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除供应商收款信息
 * @param id
 */
export const delSupplierReceivePaymentInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/purchase/supplierReceivePaymentInfo/' + id,
    method: 'delete'
  });
};
